<template>
    <a-form ref='formRef' :label-col='{span : 5}' :model='formData'>
        <a-form-item label='手机号' name='phone' showCount :maxlength="50" :rules="[{required : true, message : '请填写手机号'}]">
            <a-input type='text' v-model:value='formData.phone' show-count :maxlength="20"  />
        </a-form-item>
    </a-form>
</template>

<script lang="ts" setup>
    import { addSuperUserApi } from '@/api/User';
        import { nextTick, ref } from 'vue';

    const formRef = ref()


    
    const formData = ref<any>({
        phone : '',
    })


    async function submit() {
        let params  = await formRef.value.validate()
        return addSuperUserApi(params.phone)
    }

    defineExpose({
        submit
    })
</script>